package kr.co.doriclassic.pro12;

public class TestShape {
	public static void main(String[] args) {
		Shape[] s = new Shape[6];
		
		s[0] = new Ellipse(3);
		s[1] = new Rectangle(4,5);
		s[2] = new Triangle(4,3);
		s[3] = new Shpere(3);
		s[4] = new Cube(4,3,3);
		s[5] = new Cylinder(3,4);
		
		for (Shape sh : s) {
			if(sh instanceof TwoDimShape){
				sh.getArea();
			}
			else if(sh instanceof ThreeDimShape){
				sh.getVolume();
			}				
		}
	}	
}
